{% extends 'core/base.html' %}
{% load distro_tracker_extras%}

{% block title %}{{ block.super }} - {{ repository }} compared to {{ target_repository }}{% endblock %}

{% block content %}
{% regroup pkglist by category as category_list %}

<p>Quick links:</p>
<ul>
{% for category in category_list %}
<li><a href='#{{ category.grouper }}'>{{ categories|lookup:category.grouper }}</a>
    ({{ category.list|length }} packages)</li>
{% endfor %}
</ul>

<table style="margin-top: 15px" class="table table-striped table-sm">
{% for category in category_list %}
    <tr><th colspan="3" id='{{ category.grouper}}'
            style='text-align: center; padding-top: 15px; padding-bottom: 15px;'>
	{{ categories|lookup:category.grouper }} ({{ category.list|length }} packages)
	</th>
    </tr>
    <tr><th>Package Name</th>
	<th>Version in {{ repository }}</th>
	<th>Version in {{ target_repository }}</th>
    </tr>
    {% for pkg in category.list %}
    <tr>
	<td><a href="{% url 'dtracker-package-page' pkg.name %}">{{ pkg.name }}</a></td>
	<td>{{ pkg.deriv_version }}</td>
	<td>{{ pkg.parent_version }}</td>
    </tr>
    {% endfor %}
{% endfor %}
</table>
{% endblock %}

